import 'package:flutter/material.dart';
import 'package:flutter_eve_plugin/components/main/tab_bar.dart';
import 'package:flutter_eve_plugin/constants/font_family.dart';
import 'package:flutter_eve_plugin/constants/font_weight.dart';
import 'package:flutter_eve_plugin/pages/main/actions.dart';
import 'package:flutter_eve_plugin/utils/image_util.dart';
import 'package:flutter_eve_plugin/utils/screen_util.dart';

AppBar buildAppBar(String title, List<Widget> tabs) {
  return AppBar(
      backgroundColor: Colors.transparent,
      title: Text(
        title,
        style: TextStyle(
            fontFamily: FontFamily.PINGFANG,
            fontWeight: FontWeightCustom.PF_Medium,
            fontSize: setTextSp(18),
            color: Colors.white),
      ),
      elevation: 0,
      bottom: buildTabBar(tabs,
          labelColor: Colors.white,
          unselectedLabelColor: Color.fromRGBO(255, 255, 255, 0.6)),
      leading: Builder(
        builder: (BuildContext context) {
          return IconButton(
            icon: Image.asset(
              imageUtilYeXiu('main/icon_back2@3x'),
              width: setRatio(25),
              height: setRatio(25),
            ),
            onPressed: () {
              Navigator.canPop(context)
                  ? Navigator.pop(context)
                  : goBackNative();
            },
          );
        },
      ));
}
